home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / MARQUEE_ / DRIVER.C next >
C/C++ Source or Header  |  1990-07-16  |  674b  |  37 lines

  1. #include "marquee.h"
  2.  
  3. void    InitManagers(void);
  4.  
  5. main()
  6. {
  7.     Rect        r;
  8.     WindowPtr    w;
  9.     EventRecord e;
  10.     Str255        s1 = "\pThis string is too long",
  11.                 s2 = "\pThis string is also long";
  12.     
  13.     InitManagers();
  14.     MarqueeInit();
  15.     SetRect(&r, 40, 40, 240, 190);
  16.     w = NewWindow(NIL, &r, "\pMarquee Display", true, rDocProc, -1, false, 0);
  17.     SetPort(w);
  18.     TextFont(newYork);
  19.     MoveTo(100, 30);
  20.     MarqueeDisplay(s1, 80);
  21.     MoveTo(100, 60);
  22.     MarqueeDisplay(s2, 80);
  23.     while ( ! GetNextEvent(mDownMask,&e) )
  24.         MarqueeIdle();
  25. }
  26.  
  27. void    InitManagers(void)
  28. {
  29.     InitGraf (&thePort);
  30.     InitFonts ();
  31.     InitWindows ();
  32.     InitMenus ();
  33.     TEInit ();
  34.     InitDialogs (NIL);
  35.     FlushEvents (everyEvent, 0);
  36.     InitCursor();
  37. }